package attend

import (
	"io"
	"log"
	"net/http"

	"encoding/xml"

	"awfan.cn/implement/member"
	"awfan.cn/implement/voting"
	"awfan.cn/utils"
	"gopkg.in/mgo.v2"
	"gopkg.in/mgo.v2/bson"
)

func all(w http.ResponseWriter, body []byte,db *mgo.Database)() {

	c := db.C(utils.PkgName(COMPANIES_XML{}))

	v := COMPANIES_XML{}

	err := c.Find(nil).All(&v.Companies)

	if err != nil {

		return nil, &utils.RESP_ERROR{404, err}
	}

	return v, nil
}
